<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDistributorLevelsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distributor_levels', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 190)->index()->nullable()->comment('分销等级名称');
            $table->integer('level')->index()->default(1)->comment('分销级别 1:1级分销、2:2级分销 3:3级分销');
            $table->integer('one_level_bonus')->index()->default(0)->comment('1级分销比例 单位：分');
            $table->integer('two_level_bonus')->index()->default(0)->comment('2级分销比例 单位：分');
            $table->integer('three_level_bonus')->index()->default(0)->comment('3级分销比例 单位：分');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distributor_levels');
    }
}
